class ShopList{
    constructor(){
        this.proBoxT = $('.con-top-list-title')[0]
        console.log(this.proBoxT);
        this.proBanner = $('.con-banner-list')[0]
        this.miaosha = $('.miaosha-shopping-list')
        this.init()
    }
    init(){
        this.addGoodsP()
    }
    addGoodsP(){
        $.get('http://api.yuguoxy.com/api/shop/list', {pageSize:1000,pageNo:1},  (res)=> {
        var data = res.resultInfo.list.slice(0,5)
        var dataq = res.resultInfo.list.slice(5,9)
        var dataw = res.resultInfo.list.slice(10,14)
        var datae = res.resultInfo.list.slice(19,23)
        console.log(data);
        data.forEach(item=>{
            console.log(this.proBoxT);
            this.proBoxT.innerHTML += `
                    <ul>
                        <li><img src="${item.picture}" alt=""></li>
                        <li><a href="">智能家居</a></li>
                    </ul>
            `
        })
        dataq.forEach(item=>{
            this.proBanner.innerHTML += `
            <div class="con-banner">
                <img src="${item.picture}" alt="">
            </div>
            `
            this.miaosha[1].innerHTML += `
                    <ul>
                            <li><img src="${item.picture}" alt=""></li>
                    </ul>
            `
        })
        dataw.forEach(item=>{
            this.miaosha[0].innerHTML += `
                    <ul>
                            <li><img src="${item.picture}" alt=""></li>
                    </ul>
            `
        })  
        datae.forEach(item=>{
            this.miaosha[2].innerHTML += `
                    <ul>
                            <li><img src="${item.picture}" alt=""></li>
                    </ul>
            `
        })
    }, 'json')
    }
}
new ShopList()

